<% import grails.persistence.Event %>
<% import org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor as Events %>
<%=packageName%>
<form name='gForm${className}' id='gForm${className}'>
  <g:hiddenField name="id" value="\${${propertyName}?.id}" />
  <g:hiddenField name="version" value="\${${propertyName}?.version}" />
  <div id="remote-content-${propertyName}"></div>
  <fieldset  class="ui-state-default ui-corner-all">
    <legend class="ui-jqgrid-titlebar ui-widget-header  ui-helper-clearfix">Create ${className}</legend>
     <table>
      <%  excludedProps = Event.allEvents.toList() << 'version' << 'id'
          props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
          Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
          props.each { p ->
             if (!Collection.class.isAssignableFrom(p.type)) {
                 cp = domainClass.constrainedProperties[p.name]
                 display = (cp ? cp.display : true)
                 if (display) { %>

            <tr>
              <td><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></td>
                <td>${renderEditor(p)}</td>
            </tr>
          <%  }   }   } %>
         </table>
  </fieldset>
  <br/>
  <div class="buttons">
    <span class="button"><input type="button" name="create-button" id="create-button" class="ui-button ui-widget ui-state-default ui-corner-all" value="\${message(code: 'default.button.create.label', default: 'Create')}" onclick="executeAjax${className}();"/></span>
    <span class="button"><input type='button' name="delete-button" id="delete-button" class="ui-button ui-widget ui-state-default ui-corner-all" value='Delete' onclick="deleteAjax${className}();"/></span>
    <span class="button"><input type="button" name="cancel-button" id="cancel-button" class="ui-button ui-widget ui-state-default ui-corner-all" onclick=" reset_form('#gForm${className}');" value="Cancel"/></span>
  </div>
</form>
